//Tuesday, November 17 2009
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class TheTournamentDivTwo
{
public:
	int find(vector <int> points)
	{
		//int N = points.size();
		int wins = 0;
		int draw = 0;
		for(int i=0; i<points.size(); i++)
		{
			if(points[i]%2==0)
				wins += points[i]/2;
			else
			{
				draw += 1;
				wins += (points[i]-1)/2;
			}
		}
		if(draw%2 == 1) return -1;
		return wins + draw/2;
	}
};
